package luogu;

import java.util.Scanner;

public class Main15 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine().toLowerCase();
        String l = sc.nextLine();
        int index = 0 ;
        int count = 0 ;
        int firstIndex = -1;
        while (index<l.length()){
            //检查当前位置是否匹配目标单词
            if (index+s.length()<=l.length()
                    &&l.substring(index,index+s.length()).toLowerCase().equals(s)){
                //检查目标单词是否是独立单词（前面是空格或第一个  后面是空格或结尾）
                if ((index==0||l.charAt(index-1)==' ')
                    &&(index+s.length()==l.length()||l.charAt(index+s.length())==' ')){
                    count++;
                    if (firstIndex == -1){
                        firstIndex = index;
                    }
                }
            }
            index++;
        }
        if (count==0){
            System.out.println(-1);
        }else {
            System.out.println(count+" "+firstIndex);
        }
    }
}
